﻿using Day23Movies.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Day23Movies.Adapters.Mock
{
    public class HomeMockAdapter : IHomeAdapter
    {
        public MovieListViewModel GetAllMovies()
        {
            MovieListViewModel model = new MovieListViewModel();

            model.Movies = new List<MovieViewModel>(new MovieViewModel[] {
                new MovieViewModel() { UserName = "Dexter", Rating = 5, Title = "Troy",
                    PosterUrl = "https://www.movieposter.com/posters/archive/main/19/MPW-9840"
                },
                new MovieViewModel() { UserName = "Dan", Rating = 5, Title = "Gladiator",
                    PosterUrl = "https://www.movieposter.com/posters/archive/main/22/A70-11370"
                },
                new MovieViewModel() { UserName = "Justin", Rating = 5, Title = "The Avengers",
                    PosterUrl = "http://jwwartick.files.wordpress.com/2012/05/the-avengers-poster-the-avengers-24746041-1557-2250.jpg"
                }
            });

            model.AverageRating = model.Movies.Average(m => m.Rating);

            return model;
        }
    }
}